Plots

Row

Number of penguins

344

Column

Scatter Plot

Chart B

Chart C

Data

---
title: "Davut: Advanced Dashboard"
output: 
  flexdashboard::flex_dashboard:
    orientation: row  #rows #columns
    vertical_layout: fill  #scroll  #fill
    social: ["menu"]
    source_code: embed
    theme:
      version: 4
      bootswatch: slate
     
---

```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse, warn.conflicts = F)
library(palmerpenguins)  # data source
library(plotly)
library(DT)
library(fontawesome)
data("penguins")
```


Plots {data-navmenu="Pages"}
=======================================================================

sidebar {.sidebar}
-----------------------------------------------------------------------

### Penguin Stats

The number of penguins in the data is `r nrow(penguins)`

Row
-----------------------------------------------------------------------

### Number of penguins

```{r}
valueBox(nrow(penguins), icon = "fa-linux")
```


Column  {.tabset}
-----------------------------------------------------------------------



### Scatter Plot

```{r, warning=FALSE}
a = 
  penguins %>%
  ggplot(aes(x = bill_length_mm, y = bill_depth_mm, color = species)) +
  geom_point()

ggplotly(a)

# htmlwidgets for r
```


### Chart B

```{r, warning=FALSE}
penguins %>%
  ggplot(aes(x = body_mass_g, y = sex, fill = sex)) +
  geom_boxplot()
```


### Chart C

```{r, warning=FALSE}
penguins %>%
  ggplot(aes(x = flipper_length_mm, fill = species)) + 
  geom_histogram() +
  facet_wrap(~species)
```

Data {data-navmenu="Pages"}
=========================================================================

```{r}
penguins %>%
  datatable(extensions = "Buttons", options = list(dom = "Blfrtip",
                                                   buttons = c("copy", "csv",
                                                               "excel", "pdf",
                                                               "print")))
```